<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Project - Course description</title>
</head>
<body>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt" %>


<h1><c:out value="${requestScope.course.code} - ${requestScope.course.title}" /></h1>

<h3>Planned Sessions</h3>

<ol>
	<c:forEach var="s" items="${requestScope.sessions}">
		<li>
			Start date: <fmt-rt:formatDate value="${s.start}" pattern="dd/MM/yyyy"/><br />
			End date: <fmt-rt:formatDate value="${s.end}" pattern="dd/MM/yyyy"/><br />
			Location: <c:out value="${s.location.city}" /><br />
			<form method="GET" action="viewclients">
				<input type="hidden" value="${s.id}" name="sessionId" />
				<input type="submit" value="View clients" />
			</form>
			<form method="POST" action="subscribe">
				<input type="hidden" value="${s.id}" name="sessionId" />
				<input type="submit" value="Subscribe" />
			</form>
			<br />
		</li>
	</c:forEach>
</ol>

</body>
</html>